/* test_wpen.cc
* This file is part of ncursesxx library
* Copyright (c) 2003,2004 by Stanislav Ievlev
*
* This file is covered by the GNU Library General Public License,
* which should be included with libncursesxx as the file COPYING.
*/
#include <stdlib.h>
#include <string.h>
#include <curses.h>
#include <unistd.h>
#include <locale.h>


#include <string>

#include <ncurses/application.hh>
#include <ncurses/window.hh>
#include <ncurses/wpen.hh>

int
main()
{
	const char *str = "\303\204\304\211\320\257";
	wchar_t wide_str[100];

	setlocale(LC_ALL, "");

	mbstowcs(wide_str, str, strlen(str));
	wide_str[3] = 0;

	std::wstring w_s = wide_str;

	ncurses::application	app;
	ncurses::window	win;
	ncurses::wpen	pen(win);

	win.resize(30, 10);
	pen.frame();
	pen.move(1, 1);
	pen.write(w_s);

	pen.write(ncurses::wpen::acs_charT::ulcorner());
	pen.h_line(3);
	pen.v_line(3);

	::wrefresh(::stdscr); //made first screen refresh
	pen.commit();
	::doupdate();

	::wgetch(::stdscr);
}

